package com.dudu.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dudu.dto.OrderUserDto;
import com.dudu.dto.ResultDto;
import com.dudu.mapper.OrderMapper;
import com.dudu.mapper.ServicesMapper;
import com.dudu.pojo.Orders;
import com.dudu.pojo.Services;
import com.dudu.service.OrderService;
import com.dudu.service.ServicesService;
import com.dudu.vo.ConfirmPhoneVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class ServicesServiceImpl extends ServiceImpl<ServicesMapper, Services> implements ServicesService {

    @Autowired
    private ServicesMapper servicesMapper;


    @Override
    public ResultDto updateOrderService(Services services) {
        int count = servicesMapper.update(new UpdateWrapper<Services>().set("start_latitude", services.getStartLatitude())
                .set("start_longitude", services.getStartLongitude()).set("end_time", services.getEndTime())
                .eq("order_id", services.getOrderId()));
        if (count > 0) {
            return ResultDto.success("确认到达成功", null);
        }else{
            return ResultDto.error("确认到达失败", null);
        }
    }
}
